package com.mf.repository;

import com.mf.entity.GoodsSpec;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface GoodsSpecReponsitory extends JpaRepository<GoodsSpec, Integer>, JpaSpecificationExecutor<GoodsSpec> {

    @Query(value = "select id from t_spec where type_id=:typeId and name like %:name%", nativeQuery = true)
    GoodsSpec getId(@Param("typeId") int typeId,@Param("name") String name);
}
